package store.aixx.security.ch3.domain.dto;

import lombok.Data;
import store.aixx.security.ch3.annotating.PasswordMatch;
import store.aixx.security.ch3.annotating.ValidEmail;
import store.aixx.security.ch3.annotating.ValidPassword;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author yukai
 * @since 2021年12月04日 23:08
 */
@PasswordMatch
@Data
public class UserDTO {
    @NotBlank
    @NotNull
    @Size(min = 4, max = 50, message = "用户名长度必须再4 - 50 个字符之间")
    private String username;

    @NotBlank
    @NotNull
    @ValidPassword
    private String password;

    @NotBlank
    @ValidEmail
    private String email;

    @NotBlank
    @NotNull
    private String name;

    @NotBlank
    @NotNull
    private String matchPassword;

}
